const express = require('express');
const router = express.Router();
const authenticateToken = require('../middleware/authMiddleware');
const { createOrder, getOrderDetails, getUserOrders, cancelOrder } = require('../controllers/orderController');

// 创建订单（现在使用虚拟货币支付）
router.post('/', authenticateToken, createOrder);

// 获取订单详情
router.get('/:orderId', authenticateToken, getOrderDetails);

// 获取用户的所有订单
router.get('/', authenticateToken, getUserOrders);

// 取消订单
router.post('/cancel/:orderId', authenticateToken, cancelOrder);

module.exports = router;